<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="A.png">
    <title>拿云·筑梦航天</title>
    <link rel="stylesheet" type="text/css" href="html_assets/antd.min.css">
    <link rel="stylesheet" type="text/css" href="html_assets/index.css">
    <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
    <div id="app">
        <!--头-->
        <nav>
           <ul id="nav-ul">
                <li id="nav-icon">
                    <a onclick="loadDoc('#')">
                        <strong style="font-size: 25px">筑梦航天</strong>
                    </a>
                    
                </li>
                <li id="nav-search">
                    <form>
                        <input type="text" id="nav-inpt" placeholder="请输入">
                        <button type="submit"></button>
                    </form>
                </li>
                <li id="nav-changeBG">
                    <a href='https://gitee.com/CQYS-202404/10.1'><img src='https://gitee.com/CQYS-202404/10.1/widgets/widget_6.svg' alt='Fork me on Gitee'></img></a>
                </li>
           </ul>
        </nav>
    
        <main>          
            <container>
                <div id="main-left" style="width: 25%;">
                    <div id="main-left-box">
                        <!-- 同级目录 -->
                        <ul id="main-index"></ul>
                    </div>                   
                </div>
            </container> 
            <div id="main-center" style="width: 65%">
                <div id="doc-content"></div>
                <footer></footer>
            </div>  
        </main>
        
    </div>
</body>
<script>
    $(document).ready(function(){ 
        //分类名
        let sort = [
            "前言",
            "中国航天",
            "新冠病毒",
            "科技先锋",
        ]
        //目录数据
        let tag = [
            {//sort所属分类序号order排列序号
            //
                name:"编者的话",
                sort:0,
                order:1,
                url:"#manual/1_start.md"
            },   
            {//sort所属分类序号order排列序号
            //
                name:"两弹元勋",
                sort:1,
                order:1,
                url:"#manual/两弹一星.md"
            },          
            {
                name:"载人航天",
                sort:1,
                order:1,
                url:"#manual/载人航天.md"
            },
            {
                name:"航天英雄",
                sort:1,
                order:1,
                url:"#manual/航天英雄.md"
            },
            {
                name:"书本推荐",
                sort:1,
                order:1,
                url:"#manual/天地九重.md"
            },
            //获奖作文
            {
            name:"我的航天梦",
                sort:3,
                order:1,
                url:"#manual/我的航天梦.md"
            },
            {
            name:"第一次·冲向火星",
                sort:3,
                order:1,
                url:"#manual/第一次·冲上火星.md"
            },            
            {
            name:"疫情信息",
                sort:2,
                order:1,
                url:"https://voice.baidu.com/act/newpneumonia/newpneumonia/?from=osari_aladin_banner&city=%E9%87%8D%E5%BA%86-%E9%87%8D%E5%BA%86"
            },     
            {
            name:"中高风险地区查询",
                sort:2,
                order:1,
                url:"http://m.cq.bendibao.com/news/yqdengji/?src=baidu&qu=%E6%B8%9D%E5%8C%97%E5%8C%BA"
            },       
            {
            name:"疫情出行政策查询",
                sort:2,
                order:1,
                url:"https://a2j1a3.smartapps.cn/doctor/pages/epidemic/index/index?src=baidu"
            },      
            
        ]
        for(let i in sort){
            $('<li id="main-sort'+i+'">'+sort[i]+'</li>').appendTo($('#main-index'))
        }
        for(let k in tag){ 
            let addNode = '<a name="a'+tag[k].sort+'-'+tag[k].order+'" href='+tag[k].url+'>'+tag[k].name+'</a>'
            let sortNode = '#main-sort'+tag[k].sort
            if(!($(sortNode).children('a').length)){
                //第一个插进来的
                $(addNode).appendTo($(sortNode))
            }
            else{
                //不是第一个插进来的
                let lastChildNode = $(sortNode).children(':last-child')
                let lastChildOrder = parseInt(getNumber(lastChildNode,'a'+tag[k].sort+'-'))
                rank(tag[k],lastChildOrder,lastChildNode)
            }
        
        }
        function rank(data,lastorder,lastnode){
            let addNode = '<a name="a'+data.sort+'-'+data.order+'" href='+data.url+'>'+data.name+'</a>'
            let sortNode = '#main-sort'+data.sort
            if(data.order==0){
                $(sortNode).children(':first-child').before(addNode)
            }else{
                while(data.order<lastorder){
                    lastnode = lastnode.prev()
                    lastorder = parseInt(getNumber(lastnode,'a'+data.sort+'-'))             
                }
                lastnode.after(addNode)
            }    
        }
        function getNumber(node,str){
            return node.attr('name').split(str)[1]
        }
     })
     
       
     
</script>
<script src="html_assets/moment-with-locales.js"></script>
<script src="html_assets/vue.min.js"></script>
<script src="html_assets/antd-with-locales.min.js"></script>
<script src="html_assets/zepto.min.js"></script>
<script src="html_assets/commonmark.js"></script>
<script src="html_assets/documents.js"></script>
<script src="html_assets/index.js"></script>
<strong>网站作者：陈卓、唐奈尘</strong>
</html>